#!/bin/bash

export OPENBLAS_NUM_THREADS=1
export MKL_THREADING_LAYER=sequential

# ./online2_nnet3_pipeline_decoder conf/option.conf

# ./online2_nnet3_pipeline_decoder option.conf

model_name=$(realpath model/HCLG.fst | xargs dirname | xargs basename)

echo $model_name

# ./online2_nnet3_pipeline_decoder "option.conf" "ark:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/utt2spk" \
#         "scp:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/wav.scp" > result/${model_name}.result
# python bin/process_result.py result/${model_name}.result result/${model_name}.nofilter.hyp
# or
./online2_nnet3_pipeline_decoder "option.conf" "ark:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/utt2spk" \
        "scp:/data/cfs/asr_data/meichaoyang001/audio/dabanhui/dabanhui_20211026/wav.scp"| python bin/process_result.py > result/${model_name}.nofilter.hyp

python bin/filter.py result/base.lab result/${model_name}.nofilter.hyp result/${model_name}.hyp

mkdir -p result/score
~/.tmp/jianwei_athena/tools/SCTK/bin/sclite -f 1 -i wsj -r result/base.lab \
    -h result/${model_name}.hyp -e utf-8 -o all -O result/score -f 1
